Programming For Beginners : 2 Manuscripts - SQL & PYTHON by Byron Francis

Programming For Beginners : 2 Manuscripts - SQL & PYTHON by Byron Francis

Author:Byron Francis
Language: eng
Format: azw3
Publisher: UNKNOWN
Published: 2016-11-25T08:00:00+00:00


The INVENTORY database should now contain four tables: COMPACT_DISCS, CD_LABELS, MUSIC_TYPES, and COMPACT_DISC_TYPES. The

COMPACT_DISC_TYPES table, which you just created, contains two columns, COMPACT_DISC_ID and TYPE_ID, both of which are defined with the INT data type. In subsequent Try This exercises, you will continue to build on this database by adding new tables and modifying existing ones.

Chapter 3 Self Test

1. Which kinds of base tables can you create by using a CREATE TABLE statement?

A Persistent base tables

B Global temporary base tables

C Created local temporary tables

D Declared local temporary tables

2. What is the primary difference between a global temporary table and a created local temporary table?

3. You’re creating a table named AGENTS. The table includes the AGENT_ID column, which has an INT data type, and the AGENT_NAME column, which has a CHAR(60) data type. What SQL statement should you use?

4. What are the three types of data types that SQL supports?

5. What are the four types of string data types?

6. A(n) ____________ data type permits values that are based on data bits, rather than character sets or collations. This type of data type allows only values of 0 and 1.

7. What are the precision and the scale of the number 5293.472?

8. What are the differences between exact numeric data types and approximate numeric data types?

9. Which data types are exact numeric data types?

A DOUBLE PRECISION

B DECIMAL

C REAL

D SMALLINT

10. A(n) ____________ data type specifies the year, month, and day values of a date.

11. What are the two types of interval data types that SQL supports?

12. Which data type should you use to support a true/false construct that can be used for comparing values?

13. You are creating a distinct user-defined type named CITY. The user type is based on the CHAR(40) data type. Which SQL statement should you use?

14. You’re creating a table named CUSTOMERS. The table includes the CUSTOMER_NAME column and the CUSTOMER_CITY column. Both columns have a VARCHAR(60) data type. The CUSTOMER_CITY column also has a default value of Seattle. Which SQL statement should you use?

15. Which SQL statement should you use to delete a column from an existing table?

16. Which SQL statement should you use to delete a table definition and all its SQL data from a database?

17. Your database includes a table named OPERA_SINGERS. You want to add a column named NATIONALITY to the table. The column should have a VARCHAR(40) data type. What SQL statement should you use?

18. You want to delete the table definition for the OPERA_SINGERS table from your database. You also want to delete all the data and any dependencies on the table. What SQL statement should you use?



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.